<?php 



/**
*说明：获取代理所有用户，返回ids字符串，以逗号隔开
* @param $agent_id
* @return $ids
* @author rongshu
* @date 2017-9-5下午9:49:05
*/
function get_agent_user_ids($agent_id){
	$userModer = D("User");
	$where_user['agent_id']=$agent_id;
	$users = $userModer->where($where_user)->field('id')->select();
	$user_ids=array();
	foreach ($users as $key => $value) {
		array_push($user_ids, $value['id']);
	}
	$user_id_str = implode(',',$user_ids);
	return $user_id_str;
}

function get_agent_money($agent_id){
	$agentModer = D("Agent");
	$where_agent['agent_id']=$agent_id;
	$agent_money = $agentModer->where($where_agent)->field('money')->find();
	return $agent_money['money'];
}

?>